<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty utf8_escape_jshtml modifier plugin
 *
 * Type:     modifier<br>
 * Name:     utf8_escape_jshtml<br>
 * Purpose:  Escape an utf8 string to use it as JS litteral in HTML page
 * @param string
 * @return string
 */
function smarty_modifier_utf8_escape_jshtml($string)
{
    return htmlspecialchars(addslashes($string),ENT_QUOTES,"UTF-8");
}

/* vim: set expandtab: */

?>
